[BLKTAP] have udev create the device for blktap
authorAndrew Warfield <andy@xensource.com>
Thu, 28 Sep 2006 20:44:00 +0000 (13:44 -0700)
committerAndrew Warfield <andy@xensource.com>
Thu, 28 Sep 2006 20:44:00 +0000 (13:44 -0700)
commit1c0ee21d44fc1918af15cfa3b56188688e931d41
tree53dbe20ee38f2a3aa1e0ad49033cb5948450cd66
parent9dd368070b9306df3f7493e8db4dac34d3ec9322
[BLKTAP] have udev create the device for blktap
This patch makes blktap Do The Right Thing(TM).  It allows udev to
create the /dev/xen/blktap[0-9] devices.

It creates a sysfs class called "xen".  This part may later be placed
someplace else, but currently blktap is the only user so it is placed in
the blktap code.

When blktap is initialized, a blktap0 sysfs class device is made.  The
other devices blktapX (X > 0) are made when the BLKTAP_IOCTL_NEWINTF
ioctl is called.  This way we don't flood the sysfs and /dev/xen with
unnecessary devices.

I added a rule in the xen-backend.rules to allow for udev to create the
blktap devices.

With this, we can really remove the code to search and create the
/dev/xen/blktap[0-9]*, but I'll leave it in for now. With the use of
udev, we really should remove that code as well as the code for creating
the evtchn device.  udev works for both of these now.  But that removal
will have to be in another patch.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c
tools/examples/xen-backend.rules